# -*- coding: utf-8 -*-,
# @File : 6.steam密码获取.py,
# @Author : lidong,
# @IDEA: PyCharm
# @Time :  2022/5/13 10:44
import requests
import execjs

url = 'https://store.steampowered.com/login/getrsakey/'
data = {
    'donotcache': '1652410248341',
    'username': '123@qq.com'
    }
headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36'
}

response_json = requests.post(url, headers=headers, data=data).json()
mod = response_json['publickey_mod']
exp = response_json['publickey_exp']

node = execjs.get()
ctx = node.compile(open('steam.js', encoding='utf-8').read())
funcName = "getpwd('{0}','{1}','{2}')".format("123456", mod, exp)
print(ctx.eval(funcName))